home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2005 Utilities / CHIP Utilities 2005 / CHIP Utilities 2005.iso / dosapps / atapicd / atapicd.txt < prev    next >
Encoding:
Text File  |  1997-08-05  |  13.6 KB  |  288 lines

  1. ATAPI CD-ROM Drive Identification Program v2.03
  2. (August, 1997)
  3.  
  4.  
  5. This program was designed to get a lot useful info from ATAPI standard
  6. features: 
  7. (1) Identify Device  (ATAPI command);
  8. (2) Drive Inquiry    (ATAPI command);
  9. (3) Mode Sense       (ATAPI command).
  10.  
  11.  
  12. The brief description of features follows below:
  13.  
  14. 1. Paging to scroll over program output  (switch -lines)
  15.    It is useful sometimes to disable paging and write output info to file.
  16.    Sample:  ATAPICD  -lines:0 >atapicd.out
  17.  
  18. 2. Make a drive controller reset if it is necessary (switch -sreset)
  19.    If first attempt to detect ATAPI device fails the program makes a
  20.    software reset of drive and try again to detect ATAPI device.
  21.    Sample:  ATAPICD  -sreset:1
  22.  
  23. 3. Debugging output for additional diagnostic (switch -debug)
  24.    It is useful for system software developers to look register contents.
  25.    But some older drives will be detected only with this option (for example,
  26.    the older 2-x CD-ROM drives).
  27.    Sample:  ATAPICD  -debug:1
  28.  
  29. 4. Can select any drive on any 4 standard controllers to identify
  30.    (switches -ds0,..,-ds7)
  31.    The following example disables primary controller looking and
  32.    tertiary controller searching.
  33.    Sample:  ATAPICD  -ds0:0  -ds1:0  -ds5:1  -ds6:1
  34.  
  35. 5. Use interrupt method to transfer a sector (switches -int0,..,-int3)
  36.    Default method to read identification sector is the polling method
  37.    but it's very useful to look how interrupt hardware logic works.
  38.    The following sample enables the interrupt method for primary controller
  39.    but note that you must provide the software interrupt number but not 
  40.    the interrupt request (IRQ) number.
  41.    Sample:  ATAPICD  -int:0x76
  42.    Please note that interrupt method is use only for Drive Identify command,
  43.    all other command are used the default polling method.
  44.    
  45. 6. User defined addresses and interrupt to identify a drive
  46.    (switches -base,-ctrl,-intu)
  47.    This is a very useful for non-standard ATAPI implementations.
  48.    You must provide both base and status register but really only base
  49.    value will be used except case when you will resetting drive by switch
  50.    -reset. Switch -base means base I/O register for EIDE controller and
  51.    switch -ctrl means the control register in the alternate status register 
  52.    set for EIDE controller.
  53.    The following table lists the default values:
  54.    controller    base    status   interrupt
  55.    primary       0x1F0   0x3F6     0x76 (IRQ14)
  56.    secondary     0x170   0x376     0x77 (IRQ15), or maybe 0x72 (IRQ10)
  57.    tertiary      0x1E8   0x3EE     0x74 (IRQ12), or maybe 0x73 (IRQ11)
  58.    quaternary    0x168   0x36E     0x72 (IRQ10), or maybe 0x71 (IRQ9)
  59.    The following example forces the program to display info only about
  60.    the user-defined drive using the interrupt method.
  61.    Sample:  ATAPICD -ds0:0 -ds1:0 -ds2:0 -ds3:0 
  62.                     -base:0x168 -ctrl:0x36E -intu:0x72
  63.  
  64. 7. Select interface language (switch -lang)
  65.    By default English language, but alternate russian not implemented yet:
  66.    Sample:  ATAPICD  -lang:0
  67.  
  68. 8. Make a drive controller reset before issue Drive Inquiry command
  69.    (switch -ireset)
  70.    It was noted some drives are need a reset after Drive Identify command
  71.    before continue therefore this switch was added.
  72.    Sample:  ATAPICD  -ireset:1
  73.    
  74. 9. Write raw dump files after each command (switch -dump)
  75.    This is useful if you want to check the program work.
  76.    Three files will appeared in current directory, their names must be
  77.    identical to drive number on the controller.
  78.    Sample:  ATAPICD  -dump:1
  79.  
  80. 10.Reverse a model identification string (switch -model)
  81.    According to the ATAPI standard this string must contain a words in
  82.    the big-endian order (Motorola style), but some drives are used
  83.    little-endian byte order.
  84.    Sample:  ATAPICD  -model:1
  85.  
  86. 11.Enable to unmask IRQ for selected controller (switch -irq0,..,-irq3,-irqu)
  87.    In some cases the PC system software (for example, BIOS) do not unmask
  88.    the corresponding IRQs for potential drives and therefore the interrupt
  89.    method will be useless. If you use this switch then a program will
  90.    be unmask the necessary IRQ bit but only during the program work.
  91.    Sample:  ATAPICD  -int0:0x76 -irq0:14
  92.  
  93. 12. Make a some delay before drive access during waiting interrupt signal
  94.     or 'no busy' state (switch -delay)
  95.     It maybe is required by some older EIDE CD-ROM drives (it is usually
  96.     enough to use value one).
  97.     Sample:  ATAPICD  -delay:1
  98.  
  99. 13. And, of course, short online help is available through
  100.     switches -? and -help.
  101.     
  102.  
  103. The program does not make any destructive actions. It only reads the
  104. device identification sector (512 bytes), inquiry device data (?? bytes),
  105. CD-ROM Capabilities pages (?? bytes) through ATAPI CD-ROM Mode Sense command
  106. and displays all found data according ATAPI specifications for CD-ROMs
  107. (ATAPI Release 2.6 was last according my information). 
  108. Note: if anybody knows more later specifications please send me these files
  109. or papers or give the exact pointers how to get them.
  110. Two classic methods are used to hardware interaction: polling (default)
  111. and interrupt. Please note: the interrupt method don't work in multitasking
  112. environments like Microsoft Windows 3.1, Microsoft Windows 95. Only polling
  113. method is extremely reliable but it is time-consuming, of course.
  114. The timing algorithm was tested on many ATAPI drives and PC computers and
  115. only some older drives had given very strange results when I used the default
  116. settings but problems were disappeared if debugging turned on.
  117.  
  118.  
  119. The program must work in most DOS versions, MS-DOS box for Microsoft
  120. Windows 3.1, MS-DOS mode for Microsoft Windows 95. Due the direct hardware
  121. access this program don't work in a MS-DOS box for the Microsoft Windows NT
  122. and maybe other emulation environments. Of course, ATAPICD don't need any
  123. help from BIOS and any other hardware driver to read the data drive.
  124. In most cases it is enough to run ATAPICD without any switches.
  125.  
  126. The very reliable method to use this program is the following:
  127. load the old MS-DOS from the system diskette and run ATAPICD program.
  128. Anyway, you will use this program as IS.
  129.  
  130. Just the same program but for ATA drives called IDE-ATA also
  131. will be available on Internet soon.
  132.  
  133. Please note,
  134. I don't support my old DOS software (IDE-ATA and ATAPICD are supported because
  135. they are best-world in their class) except DebugKit that I made for
  136. real-time systems debugging (including all DOS and Windows platforms).
  137.  
  138. And last,
  139. due private reasons, the ATAPICD source code will not available for 
  140. the public domain in near future. Sorry.
  141.  
  142.  
  143. Dmitry V. Stefankov,
  144. Freelance Software Engineer
  145. e-mail: wizard@radio-msu.net, dima@mccbn.ru
  146.  
  147. P.S.
  148. In last minute!
  149. Soon the both program IDE-ATA and ATAPICD will be merged
  150. and ported to WIN32 environment to get all information about your devices
  151. without old good plain MS-DOS.
  152.  
  153.  
  154. P.S. 
  155. The following text is the sample output from ATAPICD for my EIDE CD-ROM drive.
  156. Program was running as:  ATAPICD  -lines:0  >atapicd.out
  157. To detect CD-Audio extraction capabilities find the line
  158. <CD-ROM Capabilities and Mechanical Status Page Data> and look below
  159. for the lines <Red Book audio can be read using READ-CD command> and
  160. <CD-DA stream is accurate (recover w/o failure)>. If both lines have
  161. boolean value <YES> you're happy otherwise you will have enough problems.
  162. For exact interpretation of all fields please see the official documents
  163. and no ask me.
  164.  
  165.  
  166. ATAPI/CD-ROM Drive Info 2.01, Copyright (c) 1996, 1997 Dmitry V. Stefankov
  167. All rights reserved. Disassembly or decompilation no prohibited.
  168. .....Testing primary drive on primary controller.....
  169. ************************* Identify Device Data *********************
  170. Model number....................... Pioneer CD-ROM ATAPI Model DR-A10X  0100
  171. Serial number......................                     
  172. Firmware revision.................. E1.00A  
  173. Peripheral device type ............ CD-ROM
  174. Removable device................... yes
  175. Protocol type for device........... ATAPI
  176. Command packet size................ 12 bytes
  177. Command packet DRQ type ........... microprocessor (slow=3ms)
  178. DMA supported...................... yes
  179. LBA supported...................... yes
  180. Disabling of IORDY supported....... yes
  181. IORDY supported.................... yes
  182. Overlap operation supported........ yes
  183. PIO transfer cycle timing.......... mode 3 (180 ns, i.e. 11.1 MB/sec)
  184. SingleWord DMA transfer............ mode 2 (240 ns, i.e. 8.33 MB/sec)
  185. Support SingleWord DMA transfer.... mode 0 (960 ns, i.e. 2.08 MB/sec)
  186. Support SingleWord DMA transfer.... mode 1 (480 ns, i.e. 4.17 MB/sec)
  187. Support SingleWord DMA transfer.... mode 2 (240 ns, i.e. 8.33 MB/sec)
  188. Active SingleWord DMA transfer..... mode 2 (240 ns, i.e. 8.33 MB/sec)
  189. Support MultiWord DMA transfer..... mode 0 (480 ns, i.e. 4.17 MB/sec)
  190. Support MultiWord DMA transfer..... mode 1 (150 ns, i.e. 13.3 MB/sec)
  191. Active MultiWord DMA transfer...... mode 1 (150 ns, i.e. 13.3 MB/sec)
  192. Enhanced PIO transfer modes........ mode 3 (180 ns, i.e. 11.1 MB/sec)
  193. Min MultiWord DMA xfr cycle........ 150 ns 
  194. Manuf/rec MultiWord DMA xfr cycle.. 150 ns 
  195. Min PIO transfer w/o Flow Control.. 180 ns 
  196. Min PIO xfr w/IORDY Flow Control... 180 ns 
  197. Exp. time to release (cmd rcvd).... 100 ns 
  198. Exp. time to release (srvc cmd).... 100 us 
  199. Major version number (std)......... 3
  200. Minor version number (std)......... 9
  201. ************************ Inquiry Device Data ***********************
  202. Peripheral device type ............ CD-ROM
  203. Removable medium................... yes
  204. Vendor identification.............. PIONEER 
  205. Product identification............. CD-ROM DR-A10X  
  206. Product revision level............. 1.04
  207. ANSI version....................... 0
  208. ECMA version....................... 0
  209. ISO version........................ 0
  210. ATAPI version...................... 2
  211. Response data format............... 1
  212. Additional length (param bytes).... 42
  213. ************************ Inquiry Device Mode Pages Data ************
  214. Medium type code = 0x70 (door closed, no disc present)
  215. ********** Read Error Recovery Parameters Page Data **********
  216. ---Error correction flags---
  217. Disable correction................................. no
  218. Disable transfer on error.......................... no
  219. Post error (reports recovered errors).............. no
  220. Read continuous (w/o error recovery)............... no
  221. Transfer block (not recovered within time limits).. no
  222. Error recovery parameter........................... 0
  223. Read retry count (recovery algorithm calls)........ 30
  224. ********** CD-ROM Device Parameters Page Data **********
  225. ---Device Parameters---
  226. Minimum time in hold track state................... 8 min
  227. S units per MSF - M unit........................... 60 (std value)
  228. F units per MSF - S unit........................... 75 (std value)
  229. ********** CD-ROM Audio Control Page Data **********
  230. ---Red book audio decoders and ADPCM decoders---
  231. Support of completion status during playback....... yes
  232. Stop on track crossing during playback............. no
  233. Logical block per second of playback............... 0
  234. ---Four Red book audio decoders---
  235. Output Port 0 connected with audio channel 0
  236. Output Port 0 volume (binary,attenuation level).... 255 (0db,on)
  237. Output Port 1 connected with audio channel 1
  238. Output Port 1 volume (binary,attenuation level).... 255 (0db,on)
  239. Output Port 2 muted
  240. Output Port 2 volume (binary,attenuation level).... 0 (mute,off)
  241. Output Port 3 muted
  242. Output Port 3 volume (binary,attenuation level).... 0 (mute,off)
  243. ********** CD-ROM Capabilities and Mechanical Status Page Data **********
  244. ---General characterisctics---
  245. Drive Buffer Size (KB)................. 128
  246. Maximum Drive Speed (KBytes/second).... 1764 (Speed is ~X10)
  247. Current Drive Speed (KBytes/second).... 1764 (Speed is ~X10)
  248. Number of discrete volume levels....... 0
  249. ---Media function capability bits---
  250. CD-R disc read function (Orange Book Part II)...... yes
  251. CD-E disc read function (Orange Book Part III)..... no
  252. Read function of CD-Rs written with addr.method 2.. yes
  253. CD-R disc write function (Orange Book Part II)..... no
  254. CD-E disc write function (Orange Book Part III).... no
  255. ---Drive's capability bits---
  256. Audio play/overlap operation supported............. yes
  257. Deliver composite audio and video data stream...... no
  258. Supports digital output (IEC958) on port 1......... no
  259. Supports digital output (IEC958) on port 2......... no
  260. Read sectors in Mode 2 Form 1 (XA) format.......... yes
  261. Read sectors in Mode 2 Form 2 format............... yes
  262. Read multiple session of Photo-CD dics............. yes
  263. Red Book audio can be read using READ-CD command... yes
  264. CD-DA stream is accurate (recover w/o failure)..... yes
  265. Sub-channel data can have combined R-W info........ no
  266. R-W SubCh data de-interleaved & error corrected.... no
  267. C2 Error Pointers/C2 Blocks Error Flags support.... no
  268. International Standard Recording Code Information.. yes
  269. Media Catalog Number............................... yes
  270. Software commands really lock media into drive..... yes
  271. Drive is currently in prevented(locked) state...... no
  272. Prevent/Allow jumper present (optional)............ no
  273. Drive can eject disc using software command........ yes
  274. Drive has tray type loading mechanism.
  275. Audio level of channel has independent control..... yes
  276. Mute of each channel has independent control....... yes
  277. Device contains an embedded changer................ no
  278. Software slot selection (LOAD/UNLOAD cmd).......... no
  279. ---Drive's digital output---
  280. Data valid on rising edge of the BCK signal
  281. Left channel
  282. MSB comes first
  283. Length is 32 BCKs
  284. .....Testing secondary drive on primary controller.....
  285. .....Testing primary drive on secondary controller.....
  286. .....Testing secondary drive on secondary controller.....
  287. ATAPICD: Done.
  288.